// 引入 request 文件
import { request } from '@/utils/request.js'

//商家 - 获取微信APPID
export const shopget_app_id = () => {
    return request({
        url: '/shop/employee/get_app_id/',
        method: 'get',
        // query:params
    })
}  
//商家 - 登录
export const shopemployeelogin = (params,code) => {
    return request({
        url: '/shop/employee/login/'+code,
        method: 'post',
        query:params
    })
}   
//商家 - 一键登录
export const shopemployeewxlogin = (code) => {
    return request({
        url: '/shop/employee/wxlogin/'+code,
        method: 'get',
        // query:params
    })
}  

//商家 - 退出登录
export const shoplogout = () => {
    return request({
        url: '/shop/employee/logout',
        method: 'get',
        // query:params
    })
}  
//商家 - 加载店铺参数信息
export const shopsettings = () => {
    return request({
        url: '/shop/settings',
        method: 'get',
        // query:params
    })
}  
//商家 - 修改参数信息
export const shopsettingsupdate = (params) => {
    return request({
        url: '/shop/settings/update',
        method: 'post',
        query:params
    })
}  
//商家 - 修改店铺信息
export const shopupdate = (params) => {
    return request({
        url: '/shop/update',
        method: 'post',
        query:params
    })
}  
//商家 - 兑换金换算
export const shopmoneyconversion = (params) => {
    return request({
        url: '/shop/money/conversion',
        method: 'post',
        query:params
    })
}  
//商家 - 会员列表
export const shopmemberlist = (order,page) => {
    return request({
        url: '/shop/member/list/'+order+'/'+page, //order排序方式(1:充值 2:消费 3:注册)
        method: 'get',
        // query:params
    })
}  
//商家 - 查询会员消费流水纪录
export const shopmemberconsumption_record = (user_id,page) => {
    return request({
        url: '/shop/member/consumption_record/'+user_id+'/'+page,
        method: 'get',
        // query:params
    })
}  
//商家 - 根据用户手机后四位查询会员
export const shopmembersearch = (number) => {
    return request({
        url: '/shop/member/search/'+number,
        method: 'get',
        // query:params
    })
}
//商家 - 根据用户手机查询用户
export const shopmemberload = (number) => {
    return request({
        url: '/shop/member/load/'+number,
        method: 'get',
        // query:params
    })
}
//商家 - 根据手机号查询用户
export const shopusersearch = (number) => {
    return request({
        url: '/shop/user/search/'+number,
        method: 'get',
        // query:params
    })
}
//商家 - 添加会员
export const shopmemberadd = (params) => {
    return request({
        url: '/shop/member/add',
        method: 'post',
        query:params
    })
}
//商家 - 为会员单独添加兑换金
export const shopmemberadd_score = (params,user_id) => {
    return request({
        url: '/shop/member/add_score/'+user_id,
        method: 'post',
        query:params
    })
}
//商家 - 修改会员
export const shopmemberedit = (params,user_id) => {
    return request({
        url: '/shop/member/edit/'+user_id,
        method: 'post',
        query:params
    })
}
//商家 - 获取会员信息
export const shopmemberinfo = (user_id) => {
    return request({
        url: '/shop/member/'+user_id,
        method: 'get',
        // query:params
    })
}
//商家 - 新增店员
export const shopemployeeadd = (params) => {
    return request({
        url: '/shop/employee/add',
        method: 'post',
        query:params
    })
}  
//商家 - 编辑店员
export const shopemployeeedit = (params,id) => {
    return request({
        url: '/shop/employee/edit/'+id,
        method: 'post',
        query:params
    })
}
  
//商家 - 查看员工流水
export const shopemployeeflow = (params,employee_id) => {
    return request({
        url: '/shop/employee/flow/'+employee_id,
        method: 'post',
        query:params
    })
}
//商家 - 查询店员列表
export const shopemployeelist = (page) => {
    return request({
        url: '/shop/employee/list/'+page,
        method: 'get',
        // query:params
    })
}
//商家 - 设置店员状态
export const shopemployeestatus = (id,bo) => {
    return request({
        url: '/shop/employee/status/'+id+'/'+bo,
        method: 'get',
        // query:params
    })
}

//商家 - 查询卡列表
export const shopcardlist = (type,page) => {
    return request({
        url: '/shop/card/list/'+type+'/'+page,
        method: 'get',
        // query:params
    })
}
//商家 - 添加卡
export const shopcardadd = (params) => {
    return request({
        url: '/shop/card/add',
        method: 'post',
        query:params
    })
}  
//商家 - 查询卡列表
export const shopcardstatus = (id,bo) => {
    return request({
        url: '/shop/card/status/'+id+'/'+bo,
        method: 'get',
        // query:params
    })
}
//商家 - 修改卡
export const shopcardedit = (params,id) => {
    return request({
        url: '/shop/card/edit/'+id,
        method: 'post',
        query:params
    })
}  
//商家 - 向会员发送验证码
export const shopordersend_code = (user_id) => {
    return request({
        url: '/shop/order/send_code/'+user_id,
        method: 'get',
        // query:params
    })
}  
//商家 - 订单结算费用 {sum:''} //Number总费用
export const shopordersettle = (params,user_id) => {
    return request({
        url: '/shop/order/settle/'+user_id,
        method: 'post',
        query:params
    })
}  
//商家 - 订单结账 {sum:''} //Number总费用
export const shopordercheckout = (params,user_id) => {
    return request({
        url: '/shop/order/checkout/'+user_id,
        method: 'post',
        query:params
    })
}  
//商家 - 获取所有营销策略
export const shomarketingall = () => {
    return request({
        url: '/shop/marketing/all',
        method: 'get',
        // query:params
    })
}  
//商家 - 获取指定营销策略 //id	Number	策略ID
// mode	Number	
// 策略1的模式 (1:周几 2:日期)
// date	Array
// 策略1的日期 (周几或者几号)
// discount	Number	
// 策略1的折扣 (更高的折扣)
// threshold	Number	
// 策略2的消费兑换金门槛
// reward	Number	
// 策略2的金额奖励
export const shomarketinggetstrategy = (id) => {
    return request({
        url: '/shop/marketing/get_strategy/'+id,
        method: 'get',
        // query:params
    })
}  
//商家 - 设置指定营销策略//id	Number	策略ID
// args	Number	动态参数
export const shopmarketingsetstrategy = (params,id) => {
    return request({
        url: '/shop/marketing/set_strategy/'+id,
        method: 'post',
        query:params
    })
}
//商家 - 设置营销策略状态
// id	Number	策略ID
// bo	Number	状态(1:打开 2:关闭)
export const shomarketingsetstatus = (id,bo) => {
    return request({
        url: '/shop/marketing/set_status/'+id+'/'+bo,
        method: 'get',
        // query:params
    })
} 
//商家 - 用会员的消费兑换金兑换现金
export const shomarketingexchangecash = (user_id) => {
    return request({
        url: '/shop/marketing/exchange_cash/'+user_id,
        method: 'get',
        // query:params
    })
} 
//商家 - 交班查账
export const shopemployeereconciliation = () => {
    return request({
        url: '/shop/employee/reconciliation',
        method: 'get',
        // query:params
    })
} 
//商家 - 交班流水
export const shopemployeedailyflow = (typeid,page) => {
    return request({
        url: '/shop/employee/daily_flow/'+typeid+'/'+page,
        method: 'get',
        // query:params
    })
} 
//商家 - 获得所有省份
export const shopcommongetallprovinces = () => {
    return request({
        url: '/common/get_all_provinces',
        method: 'get',
        // query:params
    })
}
//商家 - 获得所有省份
export const shopcommongetallcity = (pid) => {
    return request({
        url: '/common/get_all_cities/'+pid,
        method: 'get',
        // query:params
    })
}
//商家 - 获得所有行业
export const shopcommongetallindustries = () => {
    return request({
        url: '/common/get_all_industries',
        method: 'get',
        // query:params
    })
}
//商家 - 申请入驻
export const shopapply = (params) => {
    return request({
        url: '/shop/apply',
        method: 'post',
        query:params
    })
}

//、、、、、、、、、、、、、、、、、用户端、、、、、、、、、、、、、、、、、、、
//用户端 - 获取微信APPID
export const userget_app_id = () => {
    return request({
        url: '/user/get_app_id/',
        method: 'get',
        // query:params
    })
}  
//用户端 - 设置微信头像
export const userset_head = (params) => {
    return request({
        url: '/user/set_head/',
        method: 'post',
        query:params
    })
}
//用户端 - 微信一键登录
export const userwxlogin = (code,type) => {
    return request({
        url: '/user/wxlogin/'+code+'/'+type,
        method: 'get',
        // query:params
    })
}  
//用户端 - 获取手机号
export const get_phone = (code) => {
    return request({
        url: '/user/get_phone2/'+code,
        method: 'get',
        // query:params
    })
}  
//用户端 - 获取手机号
export const get_phoneone = (params) => {
    return request({
        url: '/user/get_phone',
        method: 'post',
        query:params
    })
}  
//用户端 -提交经纬度
export const sync_coordinates = (params) => {
    return request({
        url: '/user/sync_coordinates',
        method: 'post',
        query:params
    })
} 
//用户端 - 获取发现商店列表
export const userget_shop_recommend = (page,params) => {
    return request({
        url: '/user/get_shop_recommend/'+page,
        method: 'post',
        query:params
    })
}
//用户端 - 获取发现商店详情
export const userget_recommend_detail = (id) => {
    return request({
        url: '/user/get_recommend_detail/'+id,
        method: 'get',
        // query:params
    })
} 
//用户端 - 获取商店列表
export const userget_shop_list = (page,params) => {
    return request({
        url: '/user/get_shop_list/'+page,
        method: 'post',
        query:params
    })
}
//用户端 - 获取商店详情
export const userget_shop_detail = (id) => {
    return request({
        url: '/user/get_shop_detail/'+id,
        method: 'get',
        // query:params
    })
}  
//用户端 - 修改城市
export const userchange_city = (params) => {
    return request({
        url: '/user/change_city',
        method: 'post',
        query:params
    })
}
  //用户端 - 绑定手机号	
  export const userbind_mobile = (params) => {
      return request({
          url: '/user/user_bind_mobile',
          method: 'post',
          query:params
      })
  }  
  //用户端 - 发送手机验证码	
  export const usersend_sms = (params) => {
      return request({
          url: '/common/user_send_sms',
          method: 'post',
          query:params
      })
  }  
//用户端 - 获取自己在指定商店的充值流水
export const userrecharge_record = (shop_id,page,params) => {
    return request({
        url: '/user/recharge_record/'+shop_id+'/'+page,
        method: 'post',
        query:params
    })
}
//用户端 - 获取自己在指定商店的消费流水
export const userconsumption_record = (shop_id,page,params) => {
    return request({
        url: '/user/consumption_record/'+shop_id+'/'+page,
        method: 'post',
        query:params
    })
}
//用户端 - 获取自己在指定商店的核销流水
export const userwrite_off_record = (shop_id,page,params) => {
    return request({
        url: '/user/write_off_record/'+shop_id+'/'+page,
        method: 'post',
        query:params
    })
}
//用户端 -  设置姓名
export const userset_name = (params) => {
    return request({
        url: '/user/set_name',
        method: 'post',
        query:params
    })
}
//用户端 - 查看我的卡包
export const usermy_card = () => {
    return request({
        url: '/user/my_card/',
        method: 'get',
        // query:params
    })
}
//用户端 - 用户服务协议
export const getservice_agreement = () => {
    return request({
        url: '/common/service_agreement/',
        method: 'get',
        // query:params
    })
}
//用户端 - 用户隐私协议
export const getprivacy_agreement = () => {
    return request({
        url: '/common/privacy_agreement/',
        method: 'get',
        // query:params
    })
}
//用户端 - 获取核对码
export const getuserget_check_code = () => {
    return request({
        url: '/user/get_check_code/',
        method: 'get',
        // query:params
    })
}
//用户端 - 兑换比例使用说明
export const getexchange_describe = (shop_id) => {
    return request({
        url: '/common/exchange_describe/'+shop_id,
        method: 'get',
        // query:params
    })
}
//用户端 - 赠送金额使用说明
export const getgift_describe = (shop_id) => {
    return request({
        url: '/common/gift_describe/'+shop_id,
        method: 'get',
        // query:params
    })
}
//用户端 - 特权使用说明
export const getinstructions = () => {
    return request({
        url: '/common/instructions/',
        method: 'get',
        // query:params
    })
}
//用户端 - 注销账号
export const userlogoff = () => {
    return request({
        url: '/user/log_off/',
        method: 'get',
        // query:params
    })
}
//用户端 - 退出登录
export const userlogout = () => {
    return request({
        url: '/user/logout/',
        method: 'get',
        // query:params
    })
}
//用户端 - 关于我们
export const commonabout_us = () => {
    return request({
        url: '/common/about_us/',
        method: 'get',
        // query:params
    })
}
//用户端 - 重新加载当前登录的用户数据
export const userreload = () => {
    return request({
        url: '/user/reload',
        method: 'get',
        // query:params
    })
}
//用户端 - 抵现卡数据 数量
export const usermy_cards = () => {
    return request({
        url: '/user/my_cards',
        method: 'get',
        // query:params
    })
}
//用户端 - 客服电话
export const get_service_phone = () => {
    return request({
        url: '/common/get_service_phone',
        method: 'get',
        // query:params
    })
}
